#include <iostream>
#include <algorithm>
#include <cstdio>
#include <array>
#include <bitset>
#include <vector>
#define poly bitset <N>
using namespace std;
#ifdef ONLINE_JUDGE

/* #define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++) */
/* char buf[1 << 23], *p1 = buf, *p2 = buf, ubuf[1 << 23], *u = ubuf; */

#endif
int read() {
    int p = 0, flg = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-') flg = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        p = p * 10 + c - '0';
        c = getchar();
    }
    return p * flg;
}
void write(int x) {
    if (x < 0) {
        x = -x;
        putchar('-');
    }
    if (x > 9) {
        write(x / 10);
    }
    putchar(x % 10 + '0');
}
bool _stmer;

const int N = 1e5 + 5, M = 2e3 + 5;

char strbuf[N];

array <vector <int>, N> f, g, h;

bool _edmer;
int main() {
    cerr << (&_stmer - &_edmer) / 1024.0 / 1024.0 << "MB\n";
#ifndef cxqghzj
    freopen("seq.in", "r", stdin);
    freopen("seq.out", "w", stdout);
#endif
    scanf("%s", strbuf);
    string s = strbuf; int n = s.size(); s = " " + s;
    scanf("%s", strbuf);
    string t = strbuf; int m = t.size(); t = " " + t;
    array <poly, 2> tp; tp[0] = tp[1] = 0;
    for (int i = 1; i <= m; i++)
        tp[t[i] - '0'][i] = 1;
    /*
    poly lst1 = 0, lst2 = 0, res; lst1[0] = lst2[0] = 1;
    for (int i = 1; i <= n; i++) {
        res = ((lst1 << 1) | (lst2 << 1)) & tp[s[i] - '0'];
        if (i == n || s[i] == s[i + 1]) lst2 = lst2 | res;
        else lst1 = lst2, lst2 = res;
    }
    if (lst2[m]) {
        puts("YES");
    }
    else puts("NO");
    */
    for (int i = 0; i <= n; i++)
        f[i].resize(m + 1, 0), g[i].resize(m + 1, 0), h[i].resize(m + 1, 0);
    g[0][0] = -1, h[0][0] = -1;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            if (tp[s[i] - '0'][j]) {
                if (g[i - 1][j - 1]) f[i][j] = g[i - 1][j - 1];
                if (h[i - 1][j - 1]) f[i][j] = h[i - 1][j - 1];
            }
            /* cerr << f[i][j] << " "; */
        }
        /* cerr << endl; */
        if (i == n || s[i] == s[i + 1]) {
            for (int j = 0; j <= m; j++)
                if (f[i][j]) h[i][j] = i;
                else h[i][j] = h[i - 1][j];
        }
        else {
            g[i] = h[i - 1];
            for (int j = 0; j <= m; j++)
                if (f[i][j]) h[i][j] = i;
        }
    }
    if (!h[n][m]) return puts("NO"), 0;
    int pos = 0;
    for (int i = n; i >= 1 && !pos; i--)
        if (f[i][m]) pos = i;
    vector <int> ans;
    while (m) {
        ans.push_back(pos);
        pos = f[pos][m];
        m--;
    }
    reverse(ans.begin(), ans.end());
    puts("YES");
    for (auto k : ans)
        write(k), putchar(32);
    puts("");
    return 0;
}
